# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.contrib import admin
from .models import User_WX,User_Agent,User_Customer

class UserWXAdmin(admin.ModelAdmin):
    model = User_WX
    radio_fields = {'type': admin.HORIZONTAL,}
    list_display = ["type","location","wx_openid","wx_nickname", "wx_avatarUrl","create_time"]
    list_filter = ['type']
    readonly_fields = ['create_time']
    date_hierarchy = 'create_time'
    ordering = ["-create_time"]


class UserAgentAdmin(admin.ModelAdmin):
    model = User_Agent
    radio_fields = {'gender': admin.HORIZONTAL,'status': admin.HORIZONTAL}
    list_display = ["name", "mobile", "gender","user_wx", "company", "photo", "in_career","certificate_no", "self_introduction","status","update_time"]
    list_filter = ['status']
    readonly_fields = ['update_time']
    date_hierarchy = 'update_time'
    ordering = ["-update_time"]

class UserCustomerAdmin(admin.ModelAdmin):
    model = User_Customer
    radio_fields = {'gender': admin.HORIZONTAL,'status': admin.HORIZONTAL}
    list_display = ["name", "mobile", "gender","user_wx", "requirements","contact_allow","status","update_time"]
    list_filter = ['status']
    readonly_fields = ['update_time']
    date_hierarchy = 'update_time'
    ordering = ["-update_time"]

admin.site.register(User_WX, UserWXAdmin)
admin.site.register(User_Agent, UserAgentAdmin)
admin.site.register(User_Customer, UserCustomerAdmin)